﻿@* 企业中心账号管理 左侧导航栏 *@

<div class="mleft">
	<div id="accountMngLeft" class="left_jobs">
		@* <div class="li link_gray6 J_hoverbut t18 select"> *@
		<div class="li link_gray6 J_hoverbut t18">
			<a href="/company/compinfo">企业资料</a>
		</div>
		<div class="li link_gray6 J_hoverbut t19 ">
			<a href="javascript:void(0)">企业风采</a>
		</div>
		<div class="li link_gray6 J_hoverbut t20 ">
			<a href="javascript:void(0)">企业认证</a>
		</div>
		<div class="li link_gray6 J_hoverbut t21 ">
			<a href="javascript:void(0)">账号安全</a>
		</div>
		<div class="li link_gray6 J_hoverbut t22">
			<a href="javascript:void(0)">我的消息</a>
		</div>
	</div>
</div>
<script>
	$(function () {
		(function (window) {

			function getHrefConfig() {
				return {
					0: [ //企业资料
						"/company/compinfo",
					],
					1: [ //企业风采
						
					],
					2: [ //企业认证

					],
					3: [ //账号安全

					],
					4: [ //我的消息

					]


				}
			}

			//获取url的pathname
			var pathname = location.pathname;
			var pathnameArr = yHelper.regex.getRegexArr(pathname, /((\/[a-z][_a-z0-9]*)+)/ig);
			if (pathnameArr.length <= 0) {
				yHelper.response.redirect("/");
				return;
			}
			pathname = pathnameArr[0];
			var hrefConfig = getHrefConfig();
			var configindex = -1;
			for (var key in hrefConfig) {
				var arr = hrefConfig[key];
				for (var m in arr) {
					if (arr[m] == pathname) {
						configindex = key;
						break;
					}
				}
				if (!!configindex && configindex >= 0) {
					break;
				}
			}
			if (!configindex || configindex < 0) {
				console.error("请在账号管理的左侧导航分部视图中配置：" + pathname);
				return;
			}
			//激活样式
			var $theLi = $("#accountMngLeft").children(".li").eq(configindex);
			$theLi.addClass("select");
			var href = $theLi.children("a").attr("href");
			if (pathname == href) {
				$theLi.children("a").attr("href", 'javascript:void(0)');
			}
		})(window)
	})
</script>

